<%@ page import="java.util.Enumeration" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022/8/23
  Time: 16:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
  <h2>session 信息</h2>
<%
    out.print("id:"+session.getId()+"<br/>");
    //session.invalidate();//失效
    out.println("创建时间："+session.getCreationTime()+"<br/>");
    out.println("上次访问时间："+session.getLastAccessedTime()+"<br/>");
    out.println("最大访问间隔："+session.getMaxInactiveInterval()+"<br/>");
    Enumeration<String> names = session.getAttributeNames();
    while (names.hasMoreElements()){
        String key = names.nextElement();
        Object value=session.getAttribute(key);
        out.print(key+"="+value+"<br/>");
    }
%>
</body>
</html>
